Add first functional tests

close #2