Prep work for Python 3.x & asyncio.

Isolate twisted code into own file.
Refactoring of project.
Added a test class.