Fixed: Delegate method fires twice when using keyboard to select rows in table view

Previously, navigating through the rows of a tableview with the arrow keys would cause the delegate method `- (BOOL)tableView:(CPTableView)aTableView shouldSelectRow:(int)rowIndex` to fire twice. This was due to the delegate method being called twice in checking whether the row could be selected.

This commit changes it so that the delegate method is called just once and the result stored.
Fix delegate selection to check the index first

In the previous patch the shouldSelectRow delegate was being stored and only called once. This changes its behaviour again to first fire the delegate to see if the row in question can be selected. If not, it will look for the next row (up or down) that may be selected and choose that one.
Fix formatting and enumerator problems
Merge pull request #1905 from ahankinson/fix-cptableview-shouldselectrow-delegate

Fixed: Delegate method fires twice when using keyboard to select rows in...
Test: clean up and fix minor errors.
Fixed: in the last few revisions, table rows could be selected despite delegate shouldSelectRow: returning NO.

This error was caused by 3612565e3a7eff35e82154736bdc3c84d47c3c83 dropping the return statement.

Refs #1905.
Merge branch 'master' of github.com:cappuccino/cappuccino