Code refactoring
a lot of small fixes (Closes #173)
Added login field (ownCloud package)
Check "Delivered-To" for identities  (Closes #160)