Added tests.
Added error message for missing APP_KEY and APP_SECRET.