Refactor to use a template

This is roughly equivalent to the commit in the original Roostagram that
can be found here:

https://github.com/bocoup-education/roost-chicago-2014-app/tree/29770c0e8760001584a2be32b119dd23a9b663e3