Add localconfig to all state functions

Abstract the opts loading to a seperate function, and check a specific kwarg