AUI-1753 Improve Character Counter checkLength() and its tests