lots of refactoring. tore out lots of stuff that will go in worker-core