Major refactor. All tests not running.