added getDirection to API
Merge branch 'master' into gh-pages