Cosmetic changes & BSD license

Changes spaces to tabs
Moved stuff to header
Added BSD license