Added settings object. Added stats function. Added template tags. Stabilized code.