Create IsSnapshot function and add tests.

Moved into function for the sake of testing.
Dropped use of grep.
Merge branch 'is_snapshot'