Update init.lua

Moved some of the more generic functions from vendor.lua to here