added tests, pass $self to plack app