Refactor rate service as model

This PR moves the rate service component to the model layer. This allows to test it using mocha. Also Fixes #1721.