[#10007] Fix parser logic when processing elements via API

Fixes inconsistencies in parsing logic with regard to processing non-cacheable/removing unprocessed tags.

See http://tracker.modx.com/issues/10007