Change search() signature

Pass SpNode as template parameter.

No functional change.
Rewrite Score extractors

Less tricky and even a bit faster. With this
version Visual Studio Ultimate 2013 Update 2 RC
runs fine even in O2 optimization.

No functional change.