added serialization to lua

http://i.imgur.com/UKXoDWy.png