Implemented encoding tests; began simplifying material encoding