Move the challenge range query logic from controller to model, introduce configuration variables for deployment specific constants