Refactored the SemanticApplier, it was too hard to follow, and it couldn't handle certain situations.
Fixed several shortcomings in the grammar that were exposed by the more rigorous code.