Major code refactor, really modular now.