std: various hacking on workcache.

Nothing too interesting, just more progress. Converted over to Mut<>, removed unsafe stuff and pure stuff, removed declared outputs, fleshed out the database bit, factored the serialization some.