add some style using eslint

also fixes a minor issue where getSegment() could return undefined instead of null
spring cleaning
add a simple test for the toString() method
refactor attribute list handling to separate file
Add TODO section