Powerlaw model

I rebased, did some minor changes and added a test. Can we merge this (assuming tests pass)?