Moved slave state API functions to the top of the header.

Review: https://reviews.apache.org/r/16237