Database now closes connection after each query and reconnects if closed to ensure no more connection and locked database problems.

Fixed more internal 500 errors.
fix for tornado error handler
Name parser performance fixed, manual searches fixed.
Fixed Name Parser issues, incorrectly matched current regex used to parse results and anime patterns didn't match 1 to 3 digit numbers for absolute.
Fix for __exit__ DB errors
Merge remote-tracking branch 'upstream/dev' into dev