Remove the location definition with the location

This sets the location definition attribute when creating the location and uses it to unregister the location definition when deleting the location. This fixes #57.