data libraries: API pep8, cleanup, repaired yet another encoding bug