Added license headers; some cleanup.