I think this now works start to finish. Need the tests, need to polish interface and code though.