Move cursor functions into their own source file

and prefix them all with fr_cursor (instead of pair). There were getting to me too many naming conflicts with the existing pair* functions.