Add an init method for non-servlet framework
Proper fix for #890