Improves language parser

1. If header is malformed, pre-cache empty array instead of parsing it each time
2. Validate locale and type cast its quality during first map iteration to reduce number of operations
3. Split locales by string "," instead of using regex /,/ to increase performance