Adds caching of getPermissions and movingStats

Also some fixes, including expiring caches on .delete() instead of just
.save().
Prevents backward sleeps from being entered via the javascript entry

[This should prevent backward sleeps completely]
Merge branch 'master' into groups