Clean up initialization code.

* Get init code out of Instance constructor.
* Move client to its own thread.
* Allow passing of parameters via embed tag attributes.