Added the ability to serialise themes. Added a simple test. Needs more work to verify that the output is correct.