big refactor of browser canvas implementation. reduced code and improved names.