Restructure

Structured the files to be more logical. Also, I may have fixed a few
bugs earlier