Set app reference in init_app

Fixes #82