Removed duplicate var declarations.
Moved some code into a separate module.
Multiple files can now be selected at once.