Update ActiveRecord queries to newer syntax

A few incidental changes here, particularly involving the migrations, which needed to be tweaked to be able to fully roll them back and forward, in order to test them.

db/migrate/20080705163959_change_duration_to_end_time.rb, for example, had two identical copies of the migration in the file, and LF line-endings. Weird!