refs #57 added tests and fixed some bugs
Merge branch 'master' of github.com:piwik/piwik