Move JS-embedded Go funcs out of Init

Should improve readability a bit