Update habralite.js

Refactoring optimization and documentation