Spawn the correct number of items when disassembling etc. Fixes #909.

Also did some cleaning.

And gave artifacts a more sensible type_id.