CSTL-1130 cleaning and refactoring html and js for mapcontext.