changing html tags clearing and putting new; adding test for it

There are problem if you wont to generate only empty html file (for example to putting it in to other template). Now its not removing all tegs and not butting new, becouse of `if($('*').length > 0) {`.
I also add test for it,