Refactor hell effect code

In preparation for some truly diabolical changes.