Integration of BN functions.
 Fix resource leak, correct interface inaccuracies.
Merge pull request #29 from sghost/with-bn

Integration of BN (BigNum) functions.