Merge Refactor attempt 1 into Develop

Implemented main major refactor and unit tests. Merge into Develop.