Miscellaneous fixes to indexing and authentication. Added 'Clear and rebuild index' button to settings page. Found errors in creating study variables fixed.