fix toHash logic (#446)
fix toHash logic (#446)

- properly detect Opal hash
- consolidate impl to a single line
- use better variable name in fromHash
Mogztter/asciidoctor.js,Mogztter/asciidoctor.js,asciidoctor/asciidoctor.js,asciidoctor/asciidoctor.js,Mogztter/asciidoctor.js,Mogztter/asciidoctor.js,asciidoctor/asciidoctor.js,asciidoctor/asciidoctor.js,asciidoctor/asciidoctor.js,Mogztter/asciidoctor.js,Mogztter/asciidoctor.js,asciidoctor/asciidoctor.js