Refactored Bowling.js functions and spec tests