Rewrite furnace and move to furnace.lua