Linked items are now correctly dereferenced when a hakpak resource is removed. Made some other fixes to the hakpak builder.