Added csrf support. Closes issue #34.