Big refactor: added several properties, and modified API and fixed doc
format