enrollment tests and cleanup

Many, many, many tests. Pep8 cleanup, some additional validation. Includes separation of data.py from api.py, to allow testing the API independently of the data layer. 

@wedaly @dianakhuang @rlucioni 
A few of the comments in this test refer to redirection, but I don't think that applies to these API calls.  Just leftover comments from the original test?