Add test for W025

This warning was not previously covered by the test suite.
Refactor warning generation

Instead of checking for this warning with every identifier, limit checks
for this warning to cases where the `function` keyword is being
processed as part of a block statement. This approach is more efficient
and more readable.
Merge pull request #1907 from jugglinmike/refactor-unnamed-fn-test

Refactor W025 Generation