Separate out functions from main part of JS code
TEMP: Use I/O abstraction class for host communication
TEMP: Communicate back to host using command-stream format