active/completed loans filter; country filter; update rails

The db has been modified to add a countries table. I used the new table
in these changes. You may also need to update your copy of the db with
this SQL dump:
https://docs.google.com/file/d/0B2iLNZ-aqMwmWjg3bi1lMUJYMzA/edit?usp=sha
ring (then run "rake db:migrate")