OpenCL constant memory support

Although the branch is "gpu_constant_memory", it currently only supports OpenCL. The pull request grew larger than I expected, and supporting constant memory in CUDA will be substantially different.

This partially addresses issue #328.
Looks like there are some stray tabs in this commit.