Refactor with promises. Create basic boilerplate for TCP client