Improve remote.js and test starts.
Improve remote.js and test starts.

- Transactions now emit 'pending' and 'lost'
- Remote now supports once().
- Tests now use 'ledger_closed' to know when to start.
- Fix quick close of remote.

wilsonianb/ripple-lib,wilsonianb/ripple-lib,ripple/ripple-lib,darkdarkdragon/ripple-lib,ripple/ripple-lib,ripple/ripple-lib,wilsonianb/ripple-lib,darkdarkdragon/ripple-lib,ripple/ripple-lib,darkdarkdragon/ripple-lib