Converted pns.{h,cpp} to a class so it can better support PN^2.