Major file refactoring

Divided files into new classes and deleted some unnecessary classes.
Added a range of new functions, some of which have not been implemented.