Changed the folder structure. Replaced the obvious instances in the code with the new 3.x stuff. Also added namespaces etc