Refactor code for OrientDB Rest API. Issue #12