Correctly update location.hash when leaving chapter overview page
Move initialization from main library to the responsible state class