Berry Phases in Electronic Structure Theory: Electric Polarization, Orbital Magnetization and Topological Insulators