Adding Grid, GridTest and BasicElement.

Part cleanup of pattern stuff.
Adding Pattern and PatternTest classes. Not complete.