Unit tests for Project API and BAO

Refactored PR civicrm/civivolunteer#147 from @rubofvil.