Adding better package validator, added upsert_tests
fixing tests
adding some tests