JS: Fix self and lots of other stuff for remote.js
JS: Fix self and lots of other stuff for remote.js

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