Switch to getBoundingClientRect() and update Retina detection to fix Firefox

Use getBoundingClientRect() instead of getBBox() to work around Firefox
SVG bug: https://bugzilla.mozilla.org/show_bug.cgi?id=612118.

Fix basic CSS issues and update scaling determination since Firefox
seems to respect the transform=scale operator and Webkit does not.
Merge branch 'fixfirefox2' into refactor