Minor changes (c detailed com.), added 5 functions

Changed the way to determine current directory. Instead of using
os.getcwd which can sometimes cause problem, use
os.path.dirname(os.path.realpath(__file__))