Refactor a bunch of identical direction-choosing code into a single function.

Also cleaned some indentation because I was touching it anyway.

Functions now using this code: examine, smash, open, close, control_vehicle.

Functions I haven't changed yet: multidrop, construct, compare, probably lots more.

There's a lot of hardcoded input character checking around.

And why are some of the direction queries red and some white? Gaargh.