Doctrine + Auth history

Added doctrine for handling database on PHP side
Added auth history accessible on every page
Misc other changes