Finite Groups with All Maximal Subgroups of Prime or Prime Square Index