WIP: move critical path computation to own class

Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>