resources.js complete overhaul, adding function to testing.js