Made some additional functionality public.
Added more tests.