Change BSD license to MIT in sublibraries and fix headers