refactor spawn codec and constructor usages

mostly the same functions as before, but with more clarity as to
what is going on wrt to 'spawn.state'. There were quite a few
unintuitive things going on. The primary purpose of this is to
set things up for additional refactoring.

- the command line arguments were dropped for consistency since
they were never used.
-the queryPort can now be configured in a reasonable manner.