Added functions for JSON builds. Assumes output 'mercenary.js'.