Allow passing options from js

Closes #14.