This also includes a couple of basic unit tests as proof that this is working. Change-Id: Iff8241b4bdfd3c97319198873527911e8ed318e1