[torchbind] Improve IValue custom class API and remove most Capsule stuff (#34848)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34848
Test Plan: Imported from OSS
Differential Revision: D20480514
Pulled By: jamesr66a
fbshipit-source-id: 1c595faf34e00aab0a6202a8902426bd310551c3