Update annotations_module.js with better selection detection.