Updated. Still untested but the framework is there.