Added checks for empty captions files and created regression tests. Did some refactoring
Updated the default langauge to be en-US in case it's missing in the input file