Rails 4 upgrade

Just some fixes that are included for the rails 4 update at https://github.com/crowbar/barclamp-crowbar/pull/1157 for getting feedback.
Hrm. I feel we should keep referencing the files below somewhere, since they are really needed in the end.