Add a dirname method to make things simple.