Minor fixes.

- Split up clra_nonlinearities:_plan_template it's easier to read
  (but still one function)
- Fixed to_host function in CLRaggedArray so it's more efficient
- Added host-side caching to CLRaggedArray, as discussed with @jaberg
- Added some more tests for CLRaggedArray