Added checks in record function to warn when events are recorded that aren't known about.
Added JS doc to all the functions.
Fixed readme and JS doc sample code so that events match.