Bugfix, added more attributes, full documentation and refactor.

Corrected some bugs related to state saving and component accessing, as it was firing events when it shouldn't, and it was pretty hard to comprehend how to manage the component.