Cleanup MATLAB/Octave environment checks

Code is more concise than before. Most important changes:
 * getEnvironment and findEnvironmentVersion into one function
 * `strcmpi` to `switch`es for environment checking
 * function to check for a deprecated environments
 * the environment is also in the TikZ output for debugging purposes