Non-linear model fitting for the measurement of thin films and surface topography