Rewrote most of pnet; added tests; simplified CLI