PR for #92

Replace SELECT and INSERT queries into a single INSERT SELECT query when generating the closure table for a new entity.