Bunch of fixes plus role-based cluster management

This currently has issues, but Alex is aware of them and would like to pull in these changes and apply his fixes to them...