Added convenience method to make singleton object factory functions.
Refactored dirty state tracking to be Hue-wide, and to do auto-refresh if and only if we actually access state. As a result, should be relatively efficient.