Switch from ftw to fts

Also, use a new debug function.
A few cleanup here and there too.