getFirstMemento and getLastMemento now use the Mediawiki-provided functions for these operations, and don't make direct database calls