Added checks to basename and dirname methods so that it honors to_str or to_path on its arguments.
Added tests for basename and dirname to ensure they allow Pathname arguments.