Bug 1918 - adds template, API and tests for presence start and end.

Gist: https://gist.github.com/rszalski/97eb360eeae0fda01f6b