Revert "Merge #637 r=@jiahuang: swap lua to use tointeger"

This reverts commit 78f648fd01c2d60ca48fd5fb91760b44be2498c4, reversing
changes made to 617455bce02ddeccc345d474869f1555546a2209.