Remove use of deprecated APIs

Also add a spec.
Ok, so I think I should just add it here then, to allow other package authors to see the deprecation, and guide them to switching over.