Fix a small typo in CPTheme.j themestate caching
Add a bunch of unit tests for CPTheme.j