Add cascading delete to make node deletion much easier

With this change deleting an entry in the `nodes` table will cause all related data to be removed from the system.