improve tpl.class.php
tabs2spaces almost everywhere