Fixes #4643. Locks the upgrade process while it is running.
Fixes #1334. Added dropdown to change the parent of a page.
Refs #1334. Prevent cycles in the pages tree.
Refs #1334. Readded hidden input in edit page form, only on page creation.
persist 'selected' state of site menu
Refs #4643. Added unlock upgrade action.
switched to matching by link name - same results, simpler code
Fixes #4764: Twitter login supports persistent and referrer forwarding
Moved upgrade lock/unlock functions to upgrade.php lib.
Fixes #4789: group_gatekeeper() and river hide closed/invisible group content more reliably
Better logic for when to forward to login
Remove unneeded code
fixed: wrong link in message notification
correct singual usage of type in elgg_get_entities_* functions
correct singual usage of subtype in elgg_get_entities_* functions
correct singual usage of type in elgg_get_entities_* functions - found
more bad usage
better usage of 'limit' in cases where this is irrelevant
fixed: wrong if statement in messages_send
File access control omits now access to owner control.
messages_send() better var names and fixed notification if sender not current user