Add explicit require for Opal
Absolute reference to Substituters::SUBS
Resolve USER_HOME with environment variable because Opal does not define Dir class
Force encoding to false when running Opal
Strings in JavaScript are immutable, replace sub! with sub + reassignment