Cleanup dev.js
Fix ui test broken by recent Ship#docked_to change
Couple small fixes
Add helper method to generate foreign reference attrs
Pass Ship#attacking by reference in json

Prevents circular references if two ships are
attacking each other. UI picks up ships / attack
cycle as normal.

Tests will be updated/added with next commit