Refactor and fix 11th, 12th, 13th edge cases.
re minify
Add QUnit tests.