Added a states mixin.
Updated class! macro to remove the inner closure.

Otherwise the result would be two nested closures, which was unnecessary.
Updated version