Refactor almost everything and clean up junk code!

TODO rewrite makefile!!