writer.py: Simplifies safe_filename() usage.

url_to_dir_path() renamed to url_to_dir_parts(). Now returns a list.
url_to_filename(), url_to_dir_parts() no longer calls safe_filename().
Implements --max-filename-length.

Closes chfoo/wpull#39.