added search support for pay, cleaned up code moderately
Merge branch 'master' of https://github.com/nalpha/ncs