Refactoring Pass 1

* Do a main loop which keeps itself alive for dealing with unhandled
  partial http responses which normally causes an exit
* Pull functions into class structure
* Added todo's for Pass 2 factoring