Check if number is an integer before converting to string
Add first lua 5.1 compatibility tests for constructs