Rewrites in progress

This is a start, but lots of the code is being reworked. Main methods are going to be in aplo.py, the check method and other related methods will be in error.py (probably going to be renamed soon), and all API methods will be in api.py