Main commit. Has mostly everything done, just needs some fixes.