Refactor note functionality as a jquery plugin

Refactor basic note functionality as a jquery plugin and other
functionality.