Ab initio quantum mechanical calculations of the structure and surface potential of layered minerals and silicates