refactor

this does essentially the same structural changes as pynsq in bitly/pynsq#52