Cloned from https://bitbucket.org/rjerome/citeproc-php