improve performance for orddict:from_list/1
improve performance for orddict:from_list/1

Improve the performance of orddict:from_list/1 by reimplementing it using
the lists module in a way that preserves backward compatibility.

The QuickCheck programs linked below were used to verify backward
compatibility:

* https://gist.github.com/vinoski/3bd216efa421c581174a
* https://gist.github.com/vinoski/c6db70e8dc725083843d

Both tests, which were run on R16B03, require the original orddict module
to be renamed to olddict, and that code:unstick_mod/1 be applied to orddict
in order to allow it to be replaced with the revised orddict.

The first QuickCheck test first generates a list of pairs of terms, then
uses the list to create both an original and revised orddict using
from_list/1, then verifies that the results of the operation are the same
for both instances. The second QuickCheck test is similar except that it
first creates an instance of the original and revised orddicts and then
folds over a randomly-generated list of orddict functions, applying each
function to each orddict instance and verifying that the results match.

The revised orddict:from_list/1 function was also tested to assess
performance against the original orddict implementation. The test program
used is available here:

* https://gist.github.com/vinoski/61772a052f3501e1e128

Since an orddict instance is implemented as a list, the test program
creates ordicts of length 1, 10, 100, and 1000 and uses them to assess
performance at each length. Performance was measured using timer:tc/3 to
time a number of iterations of various tests against the original orddict
and against the revised orddict. To test from_list/1, orddicts of lengths
1, 10, 100, and 1000 are created from a list of random pairs with integer
keys. For lengths greater than 1, two different tests are performed: one
passing a list of pairs in sorted key order, and the other passing a list
of pairs in reverse sorted key order. Since orddicts are ordered, these
orderings effect worst-case and best-case behavior of the original
orddict:from_list/2 implementation respectively.

These tests were performed against R16B02 on a Macbook Pro with an Intel
Core i7 processor running at 2.7GHz and 16GB of RAM running OS X 10.8.5,
and on a Dell system with a 3.4GHz Intel Core i7 and 16GB of RAM running
Ubuntu Linux 12.04.

The tables below show results for OS X and Linux respectively. Each table
lists the name of each test followed by two numbers, each a time in
microseconds of the average of 10 runs of the test. The first number is the
result for the original orddict, the second for the revised orddict.

As the numbers for both platforms show, the revised from_list/1 function is
always faster than the original version, in some cases quite a bit faster.

Results from OS X:
------------------
from_list length 1:                           1.789   0.116
from_list length 10 ordered:                 10.082   3.040
from_list length 10 reverse ordered:          4.853   3.604
from_list length 100 ordered:               397.213  20.134
from_list length 100 reverse ordered:        25.473  20.745
from_list length 1000 ordered:             37490.26  251.46
from_list length 1000 reverse ordered:       307.94  215.96

Results from Linux:
-------------------
from_list length 1:                           0.146   0.025
from_list length 10 ordered:                  4.729   0.815
from_list length 10 reverse ordered:          1.687   0.956
from_list length 100 ordered:               144.467   5.896
from_list length 100 reverse ordered:         6.694   5.816
from_list length 1000 ordered:             13755.19  79.413
from_list length 1000 reverse ordered:        91.54  64.308

bjorng/otp,uabboli/otp,lucafavatella/otp,ader1990/otp,bernardd/otp,NOMORECOFFEE/otp,cobusc/otp,RaimoNiskanen/otp,lhslll/otp,bjorng/otp,jj1bdx/otp,uabboli/otp,hairyhum/otp,theom/otp,vic/otp,cnbin/otp,psyeugenic/otp,potatosalad/otp,lemenkov/otp,vic/otp,matwey/otp,RichMorin/otp,vinoski/otp,psyeugenic/otp,aboroska/otp,jj1bdx/otp,palas/otp,GinjaNinja32/otp,sammoth-wazoku/otp,jamesruan/otp,emacsmirror/erlang,basho/otp,falkevik/otp,lantti/otp,vic/otp,uabboli/otp,entropiae/otp,release-project/otp,neeraj9/otp,cnbin/otp,Teino1978-Corp/erlang-otp,electricimp/otp,gjaldon/otp,isvilen/otp,emile/otp,msantos/otp,RaimoNiskanen/otp,cobusc/otp,paladim/otp,platinumthinker/otp,getong/otp,rlipscombe/otp,vladdu/otp,RichMorin/otp,lucafavatella/otp,vinoski/otp,haguenau/otp,GinjaNinja32/otp,RichMorin/otp,sitexa/otp,RaimoNiskanen/otp,Teino1978-Corp/otp,GinjaNinja32/otp,jinshana/otp,gjaldon/otp,massemanet/otp,marquisthunder/otp,Teino1978-Corp/otp,dgud/otp,emacsmirror/erlang,ahmedshafeeq/otp,massemanet/otp,release-project/otp,RJ/otp,erlang/otp,erlang/otp,marquisthunder/otp,saleyn/otp,cnbin/otp,RoadRunnr/otp,bsmr-erlang/otp,paulcager/otp,awetzel/otp,sitexa/otp,sdebnath/otp,beni55/otp,getong/otp,fenollp/otp,bjorng/otp,weisslj/otp,potatosalad/otp,sdebnath/otp,lrascao/otp,RJ/otp,lightcyphers/otp,marquisthunder/otp,emacsmirror/erlang,derek121/otp,jemsbhai/otp,lrascao/otp,derek121/otp,haguenau/otp,goertzenator/otp,mujiatong/otp,theom/otp,matwey/otp,jamesruan/otp,klarna/otp,fenollp/otp,cobusc/otp,falkevik/otp,dgud/otp,tuncer/otp,klarna/otp,legoscia/otp,RoadRunnr/otp,lemenkov/otp,msantos/otp,GinjaNinja32/otp,riverrun/otp,isvilen/otp,isvilen/otp,saleyn/otp,rlipscombe/otp,ferd/otp,mujiatong/otp,johanclaesson/otp,derek121/otp,mikpe/otp,getong/otp,electricimp/otp,jj1bdx/otp,electricimp/otp,RGafiyatullin/otp,bjorng/otp,Teino1978-Corp/erlang-otp,mujiatong/otp,RGafiyatullin/otp,lrascao/otp,saleyn/otp,jj1bdx/otp,vladdu/otp,tuncer/otp,mujiatong/otp,palas/otp,legoscia/otp,dumbbell/otp,cobusc/otp,basho/otp,lhslll/otp,lianghaivv/otp,legoscia/otp,dumbbell/otp,tuncer/otp,isvilen/otp,dumbbell/otp,stolen/otp,RJ/otp,theom/otp,vic/otp,schlagert/otp,VincentHHL/otp,paladim/otp,ahmedshafeeq/otp,getong/otp,g-andrade/otp,vinoski/otp,cnbin/otp,legoscia/otp,legoscia/otp,release-project/otp,matwey/otp,goertzenator/otp,fenollp/otp,mikpe/otp,paulcager/otp,isvilen/otp,lightcyphers/otp,legoscia/otp,isvilen/otp,bjorng/otp,sammoth-wazoku/otp,lianghaivv/otp,NOMORECOFFEE/otp,kvakvs/otp,RichMorin/otp,derek121/otp,bsmr-erlang/otp,RichMorin/otp,lrascao/otp,bernardd/otp,lianghaivv/otp,uabboli/otp,schlagert/otp,vladdu/otp,vladdu/otp,falkevik/otp,lightcyphers/otp,bsmr-erlang/otp,mikpe/otp,massemanet/otp,sitexa/otp,saleyn/otp,msantos/otp,emacsmirror/erlang,Teino1978-Corp/erlang-otp,basho/otp,neeraj9/otp,neeraj9/otp,beni55/otp,platinumthinker/otp,Teino1978-Corp/otp,benoitc/otp-1,enikki/otp,weisslj/otp,dumbbell/otp,falkevik/otp,awetzel/otp,paulcager/otp,potatosalad/otp,emile/otp,weisslj/otp,matwey/otp,lrascao/otp,jemsbhai/otp,gjaldon/otp,klarna/otp,platinumthinker/otp,sitexa/otp,goertzenator/otp,RaimoNiskanen/otp,getong/otp,ferd/otp,fenollp/otp,awetzel/otp,beni55/otp,potatosalad/otp,vinoski/otp,jj1bdx/otp,mujiatong/otp,bjorng/otp,jamesruan/otp,basho/otp,ahmedshafeeq/otp,legoscia/otp,riverrun/otp,vic/otp,marquisthunder/otp,rlipscombe/otp,benoitc/otp-1,goertzenator/otp,cobusc/otp,hairyhum/otp,riverrun/otp,lemenkov/otp,enikki/otp,awetzel/otp,stolen/otp,stolen/otp,enikki/otp,krishnakumar4a4/otp,ader1990/otp,VincentHHL/otp,aboroska/otp,schlagert/otp,dgud/otp,mujiatong/otp,emile/otp,lightcyphers/otp,weisslj/otp,electricimp/otp,jj1bdx/otp,yangchengjian/otp,entropiae/otp,emile/otp,tuncer/otp,theom/otp,weisslj/otp,haguenau/otp,getong/otp,lucafavatella/otp,vladdu/otp,dgud/otp,msantos/otp,falkevik/otp,c-rack/otp,awetzel/otp,mujiatong/otp,vladdu/otp,derek121/otp,bugs-erlang-org/otp,c-rack/otp,mikpe/otp,uabboli/otp,msantos/otp,emacsmirror/erlang,emile/otp,paulcager/otp,cnbin/otp,lhslll/otp,release-project/otp,VincentHHL/otp,psyeugenic/otp,matwey/otp,lucafavatella/otp,RGafiyatullin/otp,rlipscombe/otp,RGafiyatullin/otp,aboroska/otp,enikki/otp,lantti/otp,derek121/otp,hairyhum/otp,neeraj9/otp,jinshana/otp,vinoski/otp,psyeugenic/otp,mikpe/otp,g-andrade/otp,GinjaNinja32/otp,stolen/otp,erlang/otp,beni55/otp,vic/otp,psyeugenic/otp,lrascao/otp,enikki/otp,massemanet/otp,lightcyphers/otp,haguenau/otp,palas/otp,lightcyphers/otp,RoadRunnr/otp,palas/otp,RoadRunnr/otp,lemenkov/otp,ferd/otp,gjaldon/otp,sdebnath/otp,vladdu/otp,paulcager/otp,krishnakumar4a4/otp,NOMORECOFFEE/otp,emile/otp,enikki/otp,gjaldon/otp,lantti/otp,jamesruan/otp,potatosalad/otp,ferd/otp,bjorng/otp,bernardd/otp,psyeugenic/otp,platinumthinker/otp,Teino1978-Corp/otp,g-andrade/otp,sitexa/otp,theom/otp,sitexa/otp,sitexa/otp,lantti/otp,gjaldon/otp,aboroska/otp,vic/otp,falkevik/otp,paulcager/otp,legoscia/otp,platinumthinker/otp,benoitc/otp-1,RaimoNiskanen/otp,aboroska/otp,jemsbhai/otp,falkevik/otp,release-project/otp,release-project/otp,basho/otp,sammoth-wazoku/otp,aboroska/otp,jinshana/otp,uabboli/otp,entropiae/otp,weisslj/otp,enikki/otp,RGafiyatullin/otp,bjorng/otp,uabboli/otp,yangchengjian/otp,lianghaivv/otp,dgud/otp,c-rack/otp,ahmedshafeeq/otp,basho/otp,kvakvs/otp,c-rack/otp,bjorng/otp,sdebnath/otp,release-project/otp,electricimp/otp,dgud/otp,sammoth-wazoku/otp,jinshana/otp,erlang/otp,platinumthinker/otp,beni55/otp,Teino1978-Corp/erlang-otp,goertzenator/otp,bugs-erlang-org/otp,basho/otp,entropiae/otp,paladim/otp,fenollp/otp,jemsbhai/otp,potatosalad/otp,hairyhum/otp,rlipscombe/otp,johanclaesson/otp,Teino1978-Corp/erlang-otp,basho/otp,legoscia/otp,massemanet/otp,saleyn/otp,krishnakumar4a4/otp,lianghaivv/otp,mikpe/otp,paulcager/otp,palas/otp,massemanet/otp,basho/otp,beni55/otp,RoadRunnr/otp,mikpe/otp,jamesruan/otp,c-rack/otp,goertzenator/otp,cobusc/otp,Teino1978-Corp/otp,g-andrade/otp,jinshana/otp,yangchengjian/otp,psyeugenic/otp,weisslj/otp,bernardd/otp,uabboli/otp,erlang/otp,jemsbhai/otp,entropiae/otp,bsmr-erlang/otp,matwey/otp,isvilen/otp,getong/otp,bernardd/otp,potatosalad/otp,johanclaesson/otp,hairyhum/otp,goertzenator/otp,msantos/otp,derek121/otp,GinjaNinja32/otp,rlipscombe/otp,gjaldon/otp,sammoth-wazoku/otp,GinjaNinja32/otp,RichMorin/otp,jj1bdx/otp,lhslll/otp,yangchengjian/otp,ferd/otp,platinumthinker/otp,ahmedshafeeq/otp,msantos/otp,dumbbell/otp,bugs-erlang-org/otp,lhslll/otp,theom/otp,marquisthunder/otp,riverrun/otp,cobusc/otp,benoitc/otp-1,kvakvs/otp,RoadRunnr/otp,vinoski/otp,bugs-erlang-org/otp,tuncer/otp,uabboli/otp,johanclaesson/otp,krishnakumar4a4/otp,fenollp/otp,VincentHHL/otp,emacsmirror/erlang,bugs-erlang-org/otp,ader1990/otp,theom/otp,jj1bdx/otp,jinshana/otp,beni55/otp,c-rack/otp,lemenkov/otp,sdebnath/otp,dgud/otp,electricimp/otp,ader1990/otp,dumbbell/otp,lantti/otp,mujiatong/otp,Teino1978-Corp/erlang-otp,tuncer/otp,yangchengjian/otp,vic/otp,vinoski/otp,jinshana/otp,Teino1978-Corp/erlang-otp,erlang/otp,potatosalad/otp,getong/otp,sammoth-wazoku/otp,RGafiyatullin/otp,lrascao/otp,benoitc/otp-1,lucafavatella/otp,Teino1978-Corp/otp,dumbbell/otp,krishnakumar4a4/otp,entropiae/otp,weisslj/otp,saleyn/otp,lantti/otp,bernardd/otp,c-rack/otp,yangchengjian/otp,erlang/otp,entropiae/otp,lhslll/otp,riverrun/otp,g-andrade/otp,g-andrade/otp,emile/otp,ader1990/otp,lianghaivv/otp,aboroska/otp,krishnakumar4a4/otp,paladim/otp,goertzenator/otp,johanclaesson/otp,lianghaivv/otp,bsmr-erlang/otp,cobusc/otp,isvilen/otp,falkevik/otp,vinoski/otp,RichMorin/otp,goertzenator/otp,dumbbell/otp,VincentHHL/otp,NOMORECOFFEE/otp,RichMorin/otp,mikpe/otp,paladim/otp,massemanet/otp,NOMORECOFFEE/otp,jj1bdx/otp,RJ/otp,cnbin/otp,lrascao/otp,getong/otp,sdebnath/otp,fenollp/otp,rlipscombe/otp,aboroska/otp,fenollp/otp,erlang/otp,weisslj/otp,psyeugenic/otp,jemsbhai/otp,g-andrade/otp,lightcyphers/otp,lemenkov/otp,ferd/otp,derek121/otp,palas/otp,bernardd/otp,johanclaesson/otp,g-andrade/otp,klarna/otp,NOMORECOFFEE/otp,isvilen/otp,schlagert/otp,kvakvs/otp,dgud/otp,schlagert/otp,awetzel/otp,isvilen/otp,ahmedshafeeq/otp,ferd/otp,sdebnath/otp,ferd/otp,release-project/otp,ader1990/otp,haguenau/otp,bugs-erlang-org/otp,erlang/otp,bugs-erlang-org/otp,NOMORECOFFEE/otp,rlipscombe/otp,falkevik/otp,hairyhum/otp,dgud/otp,lrascao/otp,RGafiyatullin/otp,emacsmirror/erlang,lemenkov/otp,emile/otp,g-andrade/otp,saleyn/otp,vinoski/otp,lianghaivv/otp,msantos/otp,stolen/otp,yangchengjian/otp,vladdu/otp,RaimoNiskanen/otp,potatosalad/otp,RaimoNiskanen/otp,lantti/otp,johanclaesson/otp,sammoth-wazoku/otp,dumbbell/otp,lhslll/otp,schlagert/otp,rlipscombe/otp,RoadRunnr/otp,gjaldon/otp,electricimp/otp,potatosalad/otp,RGafiyatullin/otp,RaimoNiskanen/otp,kvakvs/otp,yangchengjian/otp,palas/otp,emacsmirror/erlang,dumbbell/otp,GinjaNinja32/otp,lucafavatella/otp,VincentHHL/otp,theom/otp,fenollp/otp,bsmr-erlang/otp,krishnakumar4a4/otp,marquisthunder/otp,erlang/otp,cnbin/otp,lucafavatella/otp,neeraj9/otp,tuncer/otp,ahmedshafeeq/otp,benoitc/otp-1,marquisthunder/otp,haguenau/otp,cnbin/otp,sdebnath/otp,ahmedshafeeq/otp,entropiae/otp,riverrun/otp,emile/otp,enikki/otp,aboroska/otp,emacsmirror/erlang,riverrun/otp,bjorng/otp,rlipscombe/otp,klarna/otp,Teino1978-Corp/otp,Teino1978-Corp/otp,klarna/otp,schlagert/otp,haguenau/otp,jinshana/otp,bsmr-erlang/otp,jamesruan/otp,tuncer/otp,emacsmirror/erlang,klarna/otp,RJ/otp,paladim/otp,jemsbhai/otp,neeraj9/otp,ferd/otp,mikpe/otp,stolen/otp,bsmr-erlang/otp,tuncer/otp,neeraj9/otp,dgud/otp,vinoski/otp,paulcager/otp,palas/otp,VincentHHL/otp,kvakvs/otp,paladim/otp,RJ/otp,klarna/otp,lantti/otp,RJ/otp,massemanet/otp,benoitc/otp-1,stolen/otp,electricimp/otp,jamesruan/otp,RaimoNiskanen/otp,platinumthinker/otp,schlagert/otp,NOMORECOFFEE/otp,RoadRunnr/otp,vladdu/otp,g-andrade/otp,riverrun/otp,lightcyphers/otp,bernardd/otp,krishnakumar4a4/otp,sammoth-wazoku/otp,mikpe/otp,Teino1978-Corp/erlang-otp,bugs-erlang-org/otp,sitexa/otp,beni55/otp,paladim/otp,kvakvs/otp,hairyhum/otp,saleyn/otp,c-rack/otp,saleyn/otp,kvakvs/otp,hairyhum/otp,neeraj9/otp,marquisthunder/otp,massemanet/otp,ahmedshafeeq/otp,johanclaesson/otp,bsmr-erlang/otp,VincentHHL/otp,ader1990/otp,jemsbhai/otp,matwey/otp,RoadRunnr/otp,electricimp/otp,haguenau/otp,lucafavatella/otp,getong/otp,ader1990/otp,benoitc/otp-1,lhslll/otp,awetzel/otp,bernardd/otp,RJ/otp,awetzel/otp,kvakvs/otp,release-project/otp,stolen/otp,jamesruan/otp,matwey/otp,matwey/otp,jj1bdx/otp,lemenkov/otp