Added license and some PEP8 cleanup.