Don't bother enforcing the mimetype.
Separate template and add command line parsing (fix #2, fix #3).