Encryption refactorization

This PR should not be merged yet! I just want everyone to have a look at it and maybe test it out. The encryption is working, but of course there can be a little code cleanup and there is no update path from older vaults yet!

Please have a look at the commit descriptions for a more detailed description.

I know that this is a damn huge pull request, but I couldn't separate my changes in smaller parts. 

Fixes #2, #3, #4, #14