Create IsSnapshot function and add tests.

Moved into a function for the sake of testing. Also dropped use of grep.