Wrote a bunch of tests and added things to the admin panel

Had some time so I wrote a bunch of tests for the db models and found a bunch of bugs as well.