Simple recurrent neural network for text generation. Based on https://gist.github.com/karpathy/d4dee566867f8291f086