Implement status effects

More work is needed, but the basic framework is in place.