hunk o' code... pull out common code between old and 1.2 encoder, add back context and mdc property support for 1.2, and adapt tests for 1.2