Added configurable port

I added a configurable port to the options (with 27017 as a default value) and made options processing more robust