Improving runtime efficiency

Reworked the code to get titles from the page for user selection and retrieve JSON data from the API after the fact. Also results in fewer API calls, since we're only getting data for pages that have selected references in them.