fixed flags read on newSnap() and flipWriter();
created dedicated functions for main bitwise operations;
modified newSnap() to return false when there's nothing new and true otherwise;
included <cassert> instead of <assert.h>