Goodness of Fit Measures for Revealed Preference Tests: Complexity Results and Algorithms