Plugged in optimist for command line args, moved trailing slash method into class so it can be reused and added unit tests