Ab initio modeling of 2D and quasi-2D lead organohalide perovskites with divalent organic cations and a tunable band gap.