Semantic refactoring, progressive analysis, key classifier UTs

I seem to have flu; I hope this code doesn't suck.