Ab-Initio Theory of Moiré Superlattice Bands in Layered Two-Dimensional Materials