Javascript AI

Provides the capability to have a Javascript-based AI, and then implements a priority-based AI library. All major AIs have been moved over to the priority AI system. Several more JS methods and properties added, mainly for Ship.

Obviously needs thoroughly testing

Draft documentation at http://wiki.alioth.net/index.php/User:Cim/JSAI

Closes #39, Closes #40, Closes #35, Closes #15. Also fixes a couple of other bugs especially with commits 73db0d2, 51651f2 and 9f06814 .