Add set type

This PR adds sane object handling.
We don't need deep copies. And if we don't need deep copies there's no point, especially if we already have refcounts.