Added Logging; fixed some unit tests; cleaned up Enums and added T4 template to generate constants from the original source code; refactored some classes for clarity