Started rewrite of codebase into proper OOP.