Speed up fieldwork generation.  #3127.

Because this task is about speeding stuff up, I should measure and
present results.

Using a GET request that aliases POST /api/v1/fieldwork for the dates
[2013-01-22, 2013-01-29] on training-ncsapps, we get this out of
perftools' cputime measurement:

  Total: 2080 samples
     717  34.5%  34.5%      717  34.5% garbage_collector
     176   8.5%  42.9%      190   9.1% Enumerable#any?
      73   3.5%  46.4%     1294  62.2% ActiveSupport::JSON::Encoding::Encoder#check_for_circular_references
      69   3.3%  49.8%     1313  63.1% Hash#each
      49   2.4%  52.1%       99   4.8% ActiveSupport::JSON::Encoding::Encoder#options_for

(sampling rate is around 100 samples/sec; therefore 1 sample =~ 10 ms)

The behavior is very consistent across a small number of runs.  For the
below data, one run was done to warm up the application worker, and then
five more runs were done in succession.  The first run is not included
in the below statistics:

  mean total samples: 2082 samples (stdev: 1.154)
  mean samples in GC: 723 samples (stdev: 2.65)

The elimination of #compact does eliminate some garbage caused by
constructing unnecessary arrays, but I foudn that it didn't do all that
much for us.  (Separate it out from this commit and benchmark it if
you're unconvinced.)

I found the big win to be avoidance of JSON parsing/generation because
it relieves pressure on the storage management system: instead of having
to allocate a great many hashes and strings, we now allocate a much
smaller number of very large strings.  (Also, we cut down on database
traffic.)  The survey caching mechanism helps with this by eliminating
the need to construct ActiveRecord model objects for surveys; it also
cuts out a lot of database traffic.

After this commit, using the same methodology described above:

  Total: 750 samples
    305  40.7%  40.7%      305  40.7% garbage_collector
    101  13.5%  54.1%      111  14.8% Enumerable#any?
     36   4.8%  58.9%      377  50.3% ActiveSupport::JSON::Encoding::Encoder#check_for_circular_references
     36   4.8%  63.7%      393  52.4% Hash#each
     27   3.6%  67.3%       50   6.7% ActiveSupport::JSON::Encoding::Encoder#options_for

  mean total samples: 741 (stdev: 9.36, speedup: 2.81x)
  mean samples in GC: 299 (stdev: 7.70, speedup: 2.42x)

In terms of request time, this means going from (10 * 2082) / 1000 =
20.82 sec to 7.5 sec.  Not fast, but much less slow.

We're still spending most of our time in GC, and that sucks (because
it's not useful work), but it's much *less* time.  Next steps:

1. reduce memory usage
2. look into GC tuning (could be we're collecting too often)