Restructure of code, bugfixes, start adding tests

I'm so confused about relative imports now. I read somewhere that explicit relative imports were preferred as less brittle in case the name of the package changes (I actually looked up how to do them) but I guess that doesn't make sense as if anything changes it will all break anyway. I will change them to absolute as I trust your word on the subject!