Move JS tags to verry end of the body

It closes  #557.