moved Master class into lib/master.py