Add support for a vertical offset.

I had a need to be able to vertically offset the grid by a number of pixels. This pull request accomplishes that.

Note: I kept your code style but did introduce a bit of repetition, as I wanted to only minimally touch what you had already. If you want, I'd be happy to DRY up the pull request and resubmit.