document and test the analytics library

@sethladd, fixes #44