Componentizing legit.js.
Componentized Legit.js and added some basic tests.