Add mimetype writing function
Basic processing working cycle
Add cmd line arguments, version, and other things.
Introduce PROGNAME variable
Rearrange imports