Refactor battleship.js

Make code more concise and structure code in a way that enhances
readability