Refactor states & tabs out of modules folder & lots of code cleanup