Adding `normalizeLocale` helper function

WITH TESTS, GUYS!!! TESTS!!!