Fixed "expr: syntax error" bug on OSX

Replaced expr length command with ark
Added support for brew on OSX