pull out C++ specific part of MaterializedTuple
fix bug with class variables
Merge branch 'refactor_staged_tuple'
add another test with apply,join,union