Implemented ledger 'register' command. Enhanced the API to use the standard event emitter pattern.