Added an ordering option to getLinks() which includes a dirty hack for LIMIT