Cleaned up tabdat using defstruct properly and switched to typed-records