[loader] clean filesystem loader, rewrite tests.