Fixes #52
Merge branch 'master' into state-change-signals
Ignored clearing last_login_start_time and last_offline_start_time due to not null constraint.