Added license, readme, cleaned code.