Initial commit. Rewritten from scratch in Lua!