Cleanup
Changed log function, improved the testapp, added more callbacks