Major refactoring, start adding unit tests and test data, add preference and plugin ui panes