added test session code

modeled off of libmaple