test member and member_replicated, update leader tests to use mocks, small fixes