Updated tests and fixed tag check bug

There's more stuff here too, but I should commit more often
Add option to flush valid cache
Add missing getopt data for new flush option