added papi.avail() check for high level interface, minor file reorganization