Diff cross section optimization

* template json file
* option to fix last boundary
* automatic sub-categories in categoryOptimizationMultiDim.py
* buf-fix in shape FOM with sub-categories