Built-in analytics support.

This PR add built-in analytics support.
This allows to self hosted instances also use analytics.

It also includes:
- custom event tracking for registrations.
- custom event tracking for user invitation.