Use ftw.profilehook instead of setuphandlers

Closes #489.