Add NDArray trait type

This adds an NDArray trait type that validates on shape and dtype constraints.