Major: Switching from enums to bitmasks.

Makes it easier to pass information around: don't need to translate
using switches all the time, and I can update RitualState with far less
lines of code.