Extra tests for esd.py
Add more api tests, revealed a bug!
Add line breaks to longest lines in test_api

Not fully PEP8 compliant, but a bit better.
Additional test and improved coverage for api