Reuse magic mime code

The same lines are in guess_encoding() and guess_mimetype() - so have
guess_mimetype() call guess_encoding()
Support two different versions of magic

The API for magic has changed at some point.  Debian and Ubuntu still
have an old version, but only the new version can be installed via pip.
This commit allows us to use either version.
Add inline comments around magic API hackery
Merge branch '0.3.4-fix-magic-588'
fix incorrect instanciations of GPGProblem

with missing 'code' parameter.
cf issue #590
Merge remote-tracking branch 'origin/0.3.4-fix-GPGProblem-590'
more vim-like movements

added:
 * ctrl d = half page down
 * ctrl u = half page up
 * G = focus last entry (only search buffer for now)
remove old unread-related code completely
add config option: auto_remove_unread
implement autorm-unread

this reintroduces the automatic removal of 'unread' tag.
Instead of doing it when unfolding a message, it is now
done whenever the cursor us moved to a non-summary part
of the displayed message.

Also, it is dependant on the (new) config option 'auto_remove_unread'.
doc: checkin autogenerated docs for auto_remove_unread
pep8 fixes
fix issue with concurrent db writes

This makes sure that
1. ThreadBuffer.render does not cause unboundedly recurr
  and tries to write to the index multiple times when the index is locked.
2. makes sure that these writes - caused by our overwritten .render method -
 do not cause a change in the ui-layout by triggering notifications.
 This would confuse urwid and kill the UI.

 fix #583
prevent accidental remove-unread operations

This ensures that explicit tag-unread commands
are not reversed upon the next keypress due to the newly
triggered auto-remove unread.

Also, this replaces a global write lock with message-local
write locks for this feature, allowing to browse through
multiple messages and auto-reming the unread tag even if the index
is locked
Merge branch '0.3.4-feature-autounread'
Gracefully handle reply and reply-to-all for self sent messages.
Merge branch '0.3.4-fix-self-replies-592'