reorganize and write template tests for compiler/adapters