fix FS#970 - Unable to save file with leading / trailing spaces in layer / block names

refactor layer tools