added numerous consitency checks for sub windows. renamed some classes.
Contonued work.