Custom field implementation with new API

The new API guidelines are documented here: Implementing new Custom Field APIs in a backward-compatible manner