Fixed bug in annotation.py, improvements to JS application