Fixes plus some testing infrastructure for ditto

Summary:
Refactored stuff
Fixed some issues with the interruption handling (setting self.__log_pos instead of log_pos in binlogstream.py)
Added a ditto lock to the ditto_pos table, so that only one ditto process can act on a specific database at one time.
Added basic tests for testing mysqldump part, binlog part, and interruption handling

Test Plan: Ran tests in testing directory

Reviewers: ankur, nikita, adam, pieguy, alex, marko

Differential Revision: http://grizzly.memsql.com/D2947