Added path in url.

Page#dir was returning the wrong dir ('/') for pages in directories.
Fix pretty url style paths.

Ignore the basename if the page is an index page, preserve it if it's just an
html page and use the full path in every other case.
Fix indentation.
Merge pull request #536 from fotos/fix_page_dir

Added path in url.