Add ability to enter new collection UDFs and edit saved collection UDFs

It looks like the 3 definitions of `newInstance` are quite similar. Can they be put on the parent class?