Various functions and snippets for manipulating Lua data