Allow adding comments to directories in the code browser

Fixes #39.

Due to a different table id, top comments were not shown for directories
in the code browser. Change the `selectorToInsertBefore` to support both
files and directories.

The code browser supports keyboard shortcuts for navigating directories
which conflict with the add comment dialog, so now any keypresses within
the dialog will not be propagated to avoid this. Made the dialog modal
to reflect this.