Compare utility updated: efficiency in DB access

Adding compare.php file from test server.
Changes:
Increase efficiency of retrieving items from the database.
Basic header included as idea for possible requirement on all code files
-Lines are 1) description, 2) Copyright declaration, 3) License for this
file, 4) Primary authors (anyone who added new functions to the file),
5) Contributing authors (anyone who performs bug
fixes/documentation/other minor tasks).
Included documentation on individual functions.