Only create table if table has data in sql_table
Convert data-menu value into value_menu for context menus and add support for changing attributes

Also, fix using forEach instead of each in several loop situations.