More wholesale conversion to promises
Refactor some low-level crypto things