Added Main environment class and main function

Nit: extra newline.