3.0 - Improve cell/element error handling

This fixes the problems described in #3664. I've also converted missing element errors into exceptions, and cleaned up some dead code.
What about the missing element? That exception could cause incorrectly rendered pages, should it also be reverted to trigger_error()?