Better plugin organization, added jasmine tests and refactored the code a bit.