Added writehandler functionality, modified testapp