Allow changing parameters/dimensions for WMS and WMTS

This PR allows to dynamically change parameters and dimensions of WMS and WMTS sources. This is a collaborative work with @oterral and @twpayne.

Commit 7779ca6, which adds getDimensions and updateDimensions ol.source.WMTS, is a also a refactoring of the ol.source.WMTS code.