Restructured fivecast.py

Added main function, partially refractored