Added license

Now the important source files (but not the example) has a BSD style license in the comments at the top. The license is also included in LICENSE.md.