Refactor for PDO support, added SRAI lookup

1.) Refactored the code that deals with DB access to completely remove
the last of the mysql_* functions, including "fallback support".
2.) Added an additional table to the database to handle looking up
previously used calls to <srai> tags.