Updated for use with the newer version of the core simplicity framework.
Reorganised simplicity a little bit.