added APP_STATE enum and state variable to xApp class
to help ensure proper running state
also added _IllegalState() below _AlreadyStarted() function
synchronize on state rather than appLock for better efficiency
using new isMinMax() function
replaced xLog.getRoot() with xApp.log() in xWindow class