Work in progress. Lots of work to do. So far this is just a rough skeleton.