Rewrite patch 

It's the same PR as in https://github.com/matlab2tikz/matlab2tikz/pull/386, but targeting the `develop` branch instead of master. 

The work is almost done. I just need to re-introduce the code simplifications in `shaderOpts` and post the link to the ACID tests for reference