Move factorizable code in ol.TileUrlFunction.expandUrl
Remove expandUrl duplicated code from createFromTemplate

and make use of expandUrl function instead.
Try to expand single url for TiledWMS source
Homogenize wmts tileUrlFunction relative to other sources
Merge pull request #361 from bbinet/factorize-expandurl-code

Factorize code that expand a template url into multiples urls