Packageified code even further. Main file still ugly, working on that...