Made changes to coding style according with HACKING file.

- removed space between if/for/while statements and opening brackets;
- added extra blank lines after functions;
- added extra blank lines after declarations where they were missing;
- added void argument to functions, that take no arguments.
Added COPYING file with the BSD 2-Clause License.