Rewrote position code for the ui bubble (fixes #40 and #28)

The ui bubble is now correctly positioned when scrolling the page and resizing the browser.