major changes, accomodates installing as a wordpress plugin