Code generation with Markov Chains in CouchDB