compiles ok, singleton test pass (most of asset creation just commented out...)
urrgh. this was rather tough to get right. Main problem is avoiding switch-on-type.