Major structural changes to functions.py

Used python dictionary for input and output params for sun, moon and
other planets