Fix a bug in _findnode func, refine random number generator as static local for performance, and steal timer.c from Richard