Major code cleanup and refactor, this fixes most of the codebase issues.
Merge pull request #3 from RelentlessEmu/refactor

Major code cleanup and refactor, this fixes most of the codebase issues.