The func_test file is quite large. In order to allow new tests to be
added to a separate file, move the common test code into a separate
class, to be inherited by other classes.
Drop unnecessary imports in func_test
Signed-off-by: Simon Glass <sjg@chromium.org>