Replace bc with built-in bash math. Fixes #165.