Allow for custom setter and getter functions

Allow for custom getter and setters when reading and writing state. This
way it is possible to store the state in ways other than a string
attribute.
Fix some frosted warnings, PEP8'ify