reorganisation of snippets and supporting classes (moved to lib/)