more sophisticated code mirror bindings for scala