Improve localize.py

• Reduce memory footprint of the working dictionary by removing the module
  prefix from the key names.
• Use str.format() to avoid messy-looking multiple string concatenations.
• Switch to EAFP approach for most input file checks.
• Skip generating a few characters in the JS files (size reduction).
• Improve a few comments and variable names.