Added mocking using mock, added more tests, changed nonce to milliseconds.