More complete handling of Megatest states and statuses for teamcity. Moved emergency patches to sub directory. Fixed issue in Makefile that prevented tcmt from being built.