Better popover logic and fixed a few erb bugs

Fixed up the javascript

Left placement of import popover