Adding in scrypt support, refactoring.