Improve some boolean logic/truthiness stuff
Rewrite analyse_snippet

Test added in previous commit.

Not particularly elegant, but certainly cleaner. re.sub doesn't shine
shell here, an ideal version would use a cross between re.findall and
re.sub such that we could loop.
Rewrite/reorganize on_complete