Move SnakFactory from DataModel to lib

Needs https://gerrit.wikimedia.org/r/#/c/80373/ to be merged first

Change-Id: Id84a5e4f4f9601663c9a13876c2fae7cb8d25e6e