Length evaluation moved outside the loop

Standard JS best practice
Length evaluation moved outside the for-loop

Standard JS best practice
Added try/catch to avoid errors when cookies/storage is disabled
Merge remote-tracking branch 'origin/pr/60'
merged issue 63
rebuild min.js