Replaced chars with shorts in CoordinateSystem.
Added constants to clarify which neighbor is which.