Adding tests and fixing egg.py