add debug functions and fix path finding algo

clean up source code and add binary tree database to save
full mouse path before calcualting fast path.