Added some rudamentory grid control

and tidied some other things up. This is all going to have to be split
up into sections like Effect, Pattern, Grid, etc. but for now it works.