Fixed bugs and added new dist version

Fixed old references to dimensions and stopped dimensions being a
global var.
Added new minified build