Add functional tests

parent #65