[ERC] Fixed the ERC bugs and refactored some of Will's code.

Cleaned up enchantment handler.
Other code cleanup.