Rewrite

1. only one, shared thenBy function
2. no unnecessary secondaryFunction
3. even shorter code
4. more functional: returns new functions, doesn't cause problems with `var a = firstBy(x), b = a.thenBy(y), c = a.thenBy(z)` (where previously `a`==`b`==`c`)
Merge pull request #1 from bergus/patch-1

Rewrite