Re-wrote API. Updated all documentation.