allow p:library imports and fix non-existing directories

fixes #5
fixes #13