Fixed the function to return the max id for a given scope. Now the function
takes a parameter named 'scope' and returns the largest docid that has been
used under that scope in this metacat instance (it used to return the most
recently created docid, which is clearly different). For compatibility with
older versions of metacat the routine falls back to using the username
parameter if scope is not provided, but this is deprecated in favor of using
the scope parameter.