Trim and escape filename

Implemented ideas discussed in #11 – file.name is escaped and trimmed.