analytics.js

* support for analytics.js
* refactored view helper
* fixes and improvements
* factories in sm