Fix createDimension

createDimension now accepts only IDs with: 0 < id <= dimCount+1 (the +1 since IDs start at 1, not 0) and throws an exception otherwise.
If ID < dimCount+1 remove existing dimension and create new one, otherwise append new dimension. For the latter case a new method "appendDimension" has been implemented as alias.
The tests for both methods have been extended.