Singly/hallway — pull request #614 by kristjan (2012-10-18 07:56:06+00:00)
Title: Prallelize Fitbit and sync from now -> backwards

@smurthas @beaugunderson @temas @dizzyd

Hey, I just wrote this
I might be crazy
It's gotten quite late
Review me, maybe?

These changesets do two things:

1. Fitbit data now starts syncing from the present moving backwards, rather than
your Fitbit join date forward. To accomplish this, we keep for each synclet its
current window, which initially is `joinDate...lastDeviceSync`. The active day
starts at the end of the window and moves backwards. When it crosses the
beginning of the window, we set `begin = end`, `end = newDeviceSync` and restart
the active day to `end`. Because we might sync just a partial day, we sync as
far as one day earlier than the beginning of the window just to make sure we get
everything.
1. Fitbit synclets now run in parallel. The complication here was that these
synclets are dependent on each other, but the config sandboxing didn't allow
them to communicate when shared config variables like they were before. Now we
have a special class of config vars that begin with `_` and are available to all
sandboxed synclets. When we build the sandbox, any `_var` is added to it, and
when we get back a config change, `_var` is hoisted into the top-level object.
Because synclets can again clobber each other's shared data, make sure you only
write a given `_var` from one synclet, and the rest should be read-only.

Also, made JSHint happy with`lib/taskman`.