Merge pull request #3 from sorennielsen/master

Protect against division by zero
Consistent syntax for tests

Changed initialization of vars from `var` to `:=`
Added handling for empty slice
Added link section with ref to @tv's fork
Merge pull request #1 from joliv/master

Get latest changes from upstream joliv