More unit test work and code cleanup

- Cleaned up code
- Started work on testing GenProc.LoadProcedures
- Updated KnownState.sql to account for more scenarios