Include js dependencies in the template and cover MainTemplate with unit tests

I think that script tags should be within <head> tag