refactors
major refactor/rename/test/etc
uses input stream reader in socket instead of raw input stream