Database refactory

Main goals are:
(1) To clean up Peer table and PeerDBHandler.
(2) To clean up Torrent table and TorrentDBHandler.
(3) To simplify sqlitecachedb.py.
(4) To review other DBHandlers.
(5) To review and if necessary to rewrite database unit tests.