Changepassword module, write lastActivity on each request, check lastActivity for recentness, logout if lastActivity is too old