Unused functions with cyclic dependencies are now also warned as unused

Closes #1105