More efficient preallocation when reading large files into memory.
Minor refactoring in JS parser.