Use devise for user authentication in Rails

A WIP fix for #174