title: Can't get browserify to work, gives Reference Error
body: <p>I'm trying to build bitcore so that t works in the browser. These are the commands I ran:</p>
  
  <pre><code>npm install bitcore
  </code></pre>
  
  <p>The I made a file called index.js:</p>
  
  <pre><code>var Address = require('bitcore/lib/address');
  var Block = require('bitcore/lib/block');
  var BlockHeader = require('bitcore/lib/blockheader');
  var HDPrivateKey = require('bitcore/lib/hdprivatekey');
  var HDPublicKey = require('bitcore/lib/hdpublickey');
  var PaymentProtocol = require('bitcore/lib/paymentprotocol');
  var PrivateKey = require('bitcore/lib/privatekey');
  var PublicKey = require('bitcore/lib/publickey');
  var Script = require('bitcore/lib/script');
  var Transaction = require('bitcore/lib/transaction');
  var URI = require('bitcore/lib/uri');
  var Unit = require('bitcore/lib/unit');
  </code></pre>
  
  <p>(this taken straight from the bitcore docs: <a href="http://bitcore.io/guide/browser.html" rel="nofollow">http://bitcore.io/guide/browser.html</a>)</p>
  
  <p>then I ran this command:</p>
  
  <pre><code>browserify index.js -o bitcore-browser.js
  </code></pre>
  
  <p>It seemed to work. Here is the first few lines of the output file:</p>
  
  <pre><code>(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&amp;&amp;require;if(!u&amp;&amp;a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&amp;&amp;require;for(var o=0;o&lt;r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  var Address = require('bitcore/lib/address');
  var Block = require('bitcore/lib/block');
  var BlockHeader = require('bitcore/lib/blockheader');
  var HDPrivateKey = require('bitcore/lib/hdprivatekey');
  var HDPublicKey = require('bitcore/lib/hdpublickey');
  var PaymentProtocol = require('bitcore/lib/paymentprotocol');
  var PrivateKey = require('bitcore/lib/privatekey');
  var PublicKey = require('bitcore/lib/publickey');
  var Script = require('bitcore/lib/script');
  var Transaction = require('bitcore/lib/transaction');
  var URI = require('bitcore/lib/uri');
  var Unit = require('bitcore/lib/unit');
  
  },{"bitcore/lib/address":2,"bitcore/lib/block":3,"bitcore/lib/blockheader":4,"bitcore/lib/hdprivatekey":18,"bitcore/lib/hdpublickey":19,"bitcore/lib/paymentprotocol":24,"bitcore/lib/privatekey":28,"bitcore/lib/publickey":29,"bitcore/lib/script":30,"bitcore/lib/transaction":33,"bitcore/lib/unit":42,"bitcore/lib/uri":43}],2:[function(require,module,exports){
  (function (Buffer){
  'use strict';
  </code></pre>
  
  <p>(which i assume means it worked correctly. The file is about 2MB.)</p>
  
  <p>When I add the file to a page, none of the object are there:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script src="bitcore.browser.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;script&gt;
              var p = new PrivateKey(); // ReferenceError: PrivateKey is not defined
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I even tried to run "uglify" but that had no effect.</p>