Add modes, fix hooks
Lots of changes