Clean up file paths when importing.

Closes #1076
Add listen to the Gemfile.
Have index() return null instead of false.

Closes #832