Modified add glazing to HBSurface

Cleaned the code and tested the possibility of adding a tolerance
option. It will be an hour of work and is not really critical. I just
leave it for a later release.