Get Flexmaster to recover from a crashed master

This pull request ended up bigger than I'd like, but it took some reworking to get flexmaster to get its state back after losing a master.  

Also included in this PR is the notion that if we've got no active master we will continue to allow SELECT statements outside a transaction through.