Attach scripts to before_body_end instead of footer

before_body_end has been found to be more reliable than footer for our customers