Fix #1359: Figure out the best shell config file

This fix adds a little more intelligence to the bootstrap.sh script.

If a user is using ZSH or BASH it will recognize those and append to the appropriate config file, creating .profile if necessary.

If the user's shell cannot be read from the $SHELL variable, it will attempt to find the first suitable configuration file in the user's home directory. If none can be found, it will create .profile.

This was based off the Wikipedia article on Unix shells and the configuration files they will read. The only shells that are not supported by this patch should be csh and tcsh.
Fixed: table cells were not initialized from xib settings

Previously, table view cells (non-view-based) were not being decoded with all of the available cell attributes in IB, and many attributes were hard-coded. In addition, there was a bunch of initialization code that has been made redundant by theming.

With this commit, decoding of all control classes has been refactored so that table view cells can use the same code, thus ensuring they decode all available cell attributes. In addition, the redundant code has been eliminated.

It is now possible to apply most table cell attributes such as font, color, alignment, sendsActionOnEndEditing, and so on, directly in IB.

Closes #1803

BREAKING CHANGE:
Changes have been made to table cell decoding in nib2cib. All xibs should be re-converted with `find . -name '*.xib' -exec nib2cib {} \;`.
Docs: incorrect - CPEvent acceptsFirstMouse: documentation.
Fixed: inadvertent grid lines in token field menu.

Without this fix, grey lines were showing in the background of token field autocomplete menus in recent versions.

This fix removes the grid lines which were never intended to be there to begin with.

Fixes #1806.
Fixed: token field menu refusing clicks in recent versions.

Not clear why this worked before but not now. This fix makes sense regardless.

Without this fix, clicks would not be sent through to the token field menu because its window wasn't the key window.

This fix makes the autocomplete menu declare it does not need to and does not want to become the key window.

Fixes #1807.
Merge pull request #1805 from ahankinson/fix-issue1359

Fix #1539: Figure out the best shell config file
Fixed: empty strings and indexes out of range were not handled

Previously CPAttributedString did not provide an -init method,
with the result that an attributed string created with [[CPAttributedString alloc] init]
would not be correctly initialized.

Also, some methods that took indexes into the string were not checking for an invalid index and were not raising exceptions when the documentation said they should.

Finally, some methods that were supposed to return empty dictionaries were returning nil.

This commit fixes all of these problems. Empty strings should no longer cause errors.

Closes #533
Fix: don't touch the item state unless disabling
Revert "Fixed: table cells were not initialized from xib settings"

This reverts commit 69bbe627a9e10fc78af3cda2b8c7b4a821eed8ed until it can be implemented correctly.
Fixed: initializer did not allow programmers to pass arbitrary types

Originally the initializer had coerced the parameter to a string, even though it is clearly documented that it should be a string. A later commit removed that coercion.

This commit reinstates the type coercion and thus saves the world from those who would pass non-string types in a parameter that says "withString".
Fixed: table cells were not initialized from xib settings

This is a second attempt to fix the problems addressed by 69bbe627a9e10fc78af3cda2b8c7b4a821eed8ed.

Because table cell classes needed to use the same initialization code as the NS_initWithCoder methods, it was necessary to refactor the initialization code into separate NS_initWithCell methods and call them separately from NS_initWithCoder.
Fixed: invalid menu item validator was not checked properly

Previously, if CPApplication -targetForAction:to:from: returned nil, no check was done to see if that failed because there was no action or no valid target. If the item had no item, no target, and to action binding, it would be left enabled, which was incorrect.

This commit fixes the validation to disable the item if targetForAction:to:from: returns nil and the item has an action or target.
Define navigator.userAgent as another ugly Rhino fix
Travis CI: Use new $TRAVIS_BUILD_DIR env-variable

Before this fix: environment variables defined `.travis.yml` were still
dependant of internal configuration of the travis worker virtual
machine. See also previous pull request #1728.

With this fix, `.travis.yml` is even more generic and portable.
Merge pull request #1817 from gildegoma/travis-ci_use_build_dir_variable

Travis CI: Use new $TRAVIS_BUILD_DIR environment variable
fix for issue #1819 tableview infinate loop
Merge pull request #1820 from BlairDuncan/TableViewCursorInfinateLoopFix

fix for issue #1819 tableview infinate loop
CPTableView: force the mask to CPViewNotSizable for IB made CPTableCellView.
Added documentation for tableView:dataViewForTableColum:row: delegate method. Document other cases, when we expect the data view to have a CPViewNotSizable mask.
ViewBasedCib example: added variable row heights.