Added optional CodeIgniter BASEPATH check to top of file

- If you use this library in CodeIgniter, you can uncomment the BASEPATH
  check at the top of the file to prevent direct access to the file