Completed Lua-based spell db code. Note that EVERY reference to spells[] was changed.