Piecewise-smooth refinable functions