Added a lot

Ajax stuff
Removed PHP OO principles etc