Function isValidDirection

Returns true if the given string is a valid direction.