Break up .gitignore and correct its syntax.

Use leading / to indicate paths relative to the present directory,
move all the bits for tests/ into that sub-directory.
Merge pull request #267 from ediosyncratic/gitignore-cleanup

Break up .gitignore and correct its syntax.
README.md: remove section on unexpected behavior
Redmine#6067: install .gitignore explicitly
Merge pull request #268 from tzz/bugfix/redmine6067-install-gitignore

Redmine#6067: install .gitignore explicitly
Revert "Redmine#6067: install .gitignore explicitly"

This reverts commit 0b3a29e4cc5818e18b6e82a84a8417baba7a7c9b.