Huge refactor: Make all models object oriented (still some cleanups to make) and change all templates accordingly