rewrote the php code that queries the database

much cleaner, making it easier to read
removed files that are no longer needed by this
tool
updated readme