Reorganised files, changed exporting and some imports, seperated unit tests from other code.