Changes to work with Trireme

Depends on https://github.com/typesafehub/js-engine/pull/2