Terms layer

Add the terms layer along with associated tests.