Rework crypto stuff and added unit tests