More concise first-non-repeated-character JS solution (with tests)