Separate table code

This should replace master completely