fix P.define(), add more tests, jsFiddle