Merge pull request #85 from twmeggs/master

A few clerical corrections to comments and notes within the code.
Refactoring of TradingEnvironment to isolate the global state: index symbol and exchange timezone. Parameters that define the simulation (start, end, and capital base) were put in a new class, SimulationParameters.

Global state for the financial simulation environment is accessed through the
zipline.finance.trading module, which now contains a module variable:
environment.

Parameters are passed into an algorithm as a keyword argument, sim_params.
SimulationParameters creates a trading day index for the test period that
can be used to find trading days, calculate distance between trading days,
and other common operations. The sim params index is just selected from the
global state.

================

Details:

    - adding delorean to the requirements.
    - made index symbol a parameter for loading the benchmark data. changed
    messagepack storage to be symbol specific.
    - ported risk, performance, algorithm, transforms, batch transforms
    and associated tests to use simulation parameters and global environment
    - factory and sim factory use global state and sim params
    - factory method parameter names now reflect the class expected
TradingEnvironment allows the specification of a benchmark index and a local timezone for the exchange. This commit adds tests to verify the TradingEnvironment properly handles London Stock Exchange index, FTSE.

    - added LSE reference rrules calendar (thanks to Edward Johns)
    - added tests to verify LSE environment matches rrule calendar
    - added a test to verify global environment behavior can be set.
    - moved DailyReturn class to trading to eliminate circularity from
    risk <-> trading.
    - updated TradingEnvironment to be a context manager. This allows users
    to run algorithms in individually isolated environments in one python
    process. This is useful for managing multiple algorithms in a single
    ipython notebook.
    - added comments to explain behavior and useage of the global environment
factory had a bug in the creation of trade history that traversed daylight savings time changes. added a fix and a test.
updated run method to use sim_params.
Don't capitalize delorean in requirements.txt
created a new generator-backed trading environment for testing.
other details:
    - also fixed grammatical errors in loader's status messages.
    - converting the treasury curves to an ordered dict.
    - moved to using a lambda for clarity as per @ehebert
    - initializing calendar end dates to be midnight of current date in
    - US/Eastern. Yahoo data isn't available until midnight eastern.
Merge pull request #90 from quantopian/fake_environment

Fake environment
trying to fix broken jenkins build that seems to be due to the end time
of the trading calendar calculations and availability of data from yhoo.
changing the calendar test for lse to use the last available date
rather than the end date.
Merge pull request #91 from quantopian/calendar_fix

changing the calendar test for lse to use the last available date
(confirmed this branch builds on jenkins before merging)
Fixes crashes when using numpy log on a batch transform data panel.

The recent change to the creation of the data panel ended up with
a panel with the dtype of 'object', which was causing numpy ufuncs
like `log` to crash out on an `AttributeError`.

This forces all frames in the panel to use a dtype of 'float',
we may want to look at seeting a dtype on a frame by frame basis,
e.g. 'volume' may more accurately be 'int'.
added a decorator for applying an environment to a function context.
added functools.wraps as per @richafrank
Merge pull request #92 from quantopian/noop_env_fix_1470

added a decorator for applying an environment to a function context.
tradingcalendar was assuming eastern time when calculating its end date,
switched to use UTC and utcnow. Also factored the common code out of
the nyse and lse specific tests into a helper method.
Upgrade msgpack-python to 0.3.0
Fix flake8 error
Disable test_{,lse_}calendar_vs_environment until issue #93 is addressed

These two tests are nonessential and the test failures reflect bugs in
the tests, not bugs in the code.
Fix flake8 problem