Added 'active' flag to states, and migrated states to database vs. constant.