Added command line parsing for arguments.
Added pid file and signal catching.