Improve tables.rb readability

Remove excessive namespacing of constants in tables.rb by nesting code inside a module declaration.