pdl.py: refactoring
added pdl-tests.py