Implement sensible behaviour for cd/pwd