Update init.lua

clean up and added functions so that the mod can be used easily with other mods