improved util methods based on tests
Merge pull request #133 from jwplayer/feature/utils-tested

improved util methods based on tests