#691 - Bring in some classes for use by modules
#691 - Reorder the execution of theme and sandbox
#691 - Add NPE protection