Towards a theory of chronic pain