Ported table definition on py3, ported tests to py3