Restructure test directory. Move check for load error from each test to before/after hooks.

Add get relative path helper function.