Refactoring. convert_directory() added.
Converting files now guesses format from the extension.
Note why we're using unicode.encode() in HtmlFormatter.write().