Improve environment check and add check for curl. fixes #21