Added OptionParser support and pidfile option