Removed unnecessary memcpys.
Beginning of a big refactor to put everything into proper classes.
More refactoring.
More refactoring.
More refactoring.
More refactoring.
More refactoring.