working on refactoring chapter 2
refactored types.lua (chapter 2)
refactored expression.lua