Changed license to markdown.
Cleanup.
Revert some changed for easy upstream merge.