Upgrade to rails 4 and use the asset pipeline

This truly upgrades to rails 4, and uses the asset pipeline for including image resources.