Renames the functions to beforeFirst/afterLast. Updates some comments and the use of this when calling the functions.