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.