Improving error messages/line num. in apiconfig_test tests.

Other tests could use util functions from utils_test too.