Use a direction map to detect multiple directions

Use a direction map object to support nudging shapes in multiple
directions at once.