Componentized Legit.js and added some basic tests.