Opal support

There's a bunch of stuff, not sure everything is ok (e.g. `RUBY_PLATFORM` checks), but this seems to me the best way to discuss and eventually reach the right solution.
No to the RUBY_PLATFORM conditional, which is redundant anyway given line 5.