Added license and cleaned up extension code.