Merge pull request #251 from NielsZeilemaker/fix_statistics

Fix for community statistics
Replaced all KeyErrors by actual exceptions, fixes #247
Removed load and join community, handled by the community constructor
now.
Update my_member in community table when a different one is passed to
the constructor.
Create identity at end of constructor
Load database version and id
No more member by database id cache, fixed tracker
When inserting a member with a private key, also derive the public key
Require a public_key whenever a private key is going to be inserted
Merge pull request #252 from NielsZeilemaker/remove_keyerror

Replaced all KeyErrors by actual exceptions, fixes #247
Fix for sequence number check, messages aren't inserted in order.
Hence, we can only check after inserting all messages.
Only FullSyncDistribution has a enabled_sequence_number
Need to store max_sequence per member
Fixup
Merge pull request #253 from NielsZeilemaker/fix_sequence_number_check

Fix for sequence number check, messages aren't inserted in order.
refactory prv/pub-key checks
Add asserts for sequence numbers
Merge pull request #254 from LipuFei/fix-pkey-checks

refactory prv/pub-key checks
MAX(sequence) can be None
Merge pull request #255 from NielsZeilemaker/fix_sequence_number_check

Add asserts for sequence numbers