ENH: Factor out API methods. Add support for algo scripts.

This is a step towards the goal of uniting Quantopian scripts
and zipline.

To make the syntax of zipline identical to Quantopian
we break out the API methods (like order) and turn them into
functions. To access the algo object we add a thread local reference
to the current algorithm that is accessed in the API functions.

TradingAlgorithm now takes either a string or two functions
(initialize and handle_data) that it executes.

Note that currently there is code duplication with the API methods.
Eventually those will be obsolete once qexec adjusts to the new API.
REF: Change api import. Fix typo.
DOC: Update doc to import order.
REF: Replace order method calls with resp function calls.
REF: Call set_algo_instance in .run().
REF: Passing of algoscript now done via kwargs.
REF: Instead of copying functions use api method decorator.
REF: Move method decorator to new api_support.py.
TST: Ported appropriate algorithm tests from qexec.
TST: Removed commented code.
REF: Remove catching of algo errors.
BUG: Always clean up algo reference.
REF: Address @eherbert's comments.

REF: Resolve merge conflict
STY: Indent comments.