Some improvements, fixes to actions, add mimetype support.

Fixes #341
Fixes #360

Also:
      -- Added support for %P token to insert parent directory path
      -- Added support for multiple (unlimited) occurrences of tokens
      -- code cleanup