Add debug logging of internal operations (thanks to @soywod). Revert iOS security-framework dependency to v2 (see #225).