Added some debugging code for sql queries
Changed file formatting options
Formatting fixes
Fixed database query/struct mismatching along with some template changes