Add *.py[co] and build dirs to .gitignore.
Add tests for distarray creation. Refactor/optimize other tests.

Refactoring uses `setUpClass` instead of `setUp` where possible.
PEP 257: docstrings always use """triple double quotes"""