Removed unused fields.
Made ClassMonitor static and reduced the code.
Reworked ClassMonitor to use wait and notify