Some improvements, fixes to actions, add mimetype support.

Fixes #341
Fixes #360

Todo: Clean up action activate parsing and file list injection, and add support for parent directory token.