Use optimist module for handling phantomas options

Resolves #161