Moved mcss to a hbs template, memory leak fix

And some template remastering