Refactored the fingerprint module
Moved main Dejavu class from dejavu.control to dejavu
Cleaned up the database driver.

- The SQLDatabase class now uses a context manager for mysql access.
- Most of the error handling is done by the context manager now
- Optimized several methods that returned a list into returning a generator
- Optimized return_matches to use an IN query instead.
- Other small fixes.
Merge remote-tracking branch 'wessie/master'
Changed insert_hashes to fit the new data format
Changed insert_hashes to fit the new data format
Switched back to MySQLdb for better support of executemany.
Merge remote-tracking branch 'wessie/master'
Changed a method to fit the new hash tuples
Cleaned up Dejavu class calls (find_matches, align_matches)
Added a foreign key relationship to the create table statements.

- MySQL will also use the InnoDB engine now.
- Added a ping call in the MySQL Cursor cache mechanism
- Added a rollback call when a MySQLError occurs
- Removed 'delete_orphans' which is not needed anymore due to foreign key constraints and delete on cascade
- Changed SQLDatabase to accept options to create a cursor factory, instead of taking a pre-created cursor factory
Began moving recognizer functionality into separate classes
Changed default cursor type for mysql from DictCursor to Cursor.
Finished the changes to the recognize module
 - Recognizers now use a class structure
 - Generic code for matching is in BaseRecognizer
 - Two recognizers are available:
  - Wave file recognizer
  - Recording recognizer
Added missing 'self'
Moved mic recording constants inside MicrophoneRecognizer
Fixed some import/class mistakes
Merged with fingerprinter and recognizer cleanup
Fixed various small things that weren't caught before.

- Fixes SQL queries for table creations
- Table creation is now down in reverse order to accompany the foreign key
- Fixed a typo in the BaseRecognizer that caused it to not work
- Changed configuration passed to Dejavu into a (nested) dictionary
small fixes to pguridi PR