Initial commit of some common logic taken from various different repositories
License!