This looks like a javascript translation of the coffeescript in notes.coffee. Is that intentional/necessary?