Added a collapsed state to the options

Most of the js changes seem to be different versions
of coffeescript