merging kevin's code, unifying more module api's, more work on analytics