[CLEANUP] Clean up the use of assignments.

- Have no more than one assignment per line.
- Move side-effect assignments out of conditions.
- Use array_search in strict mode.
Merge pull request #35 from jjriv/cleanup/assignment-formatting

[CLEANUP] Clean up the use of assignments.