Move factoid javascript to dedicated file