Moving PDFJS check into promise

Before we load pdf, chech if PDFJS is defined. If not, reject promise and send error message, instead of having a check that just returns and stop the script if undefined.
Merge pull request #3 from JohnTheDaniel/err

Moving PDFJS check into promise