Add code optimization to bundling

Adds code optimization during bundling process.

Problem to solve

However fatscript is not intended to be compiled the interpreter could optimize some aspects of the code during the bundling process for performance gains.

Proposal

Some of the imagined optimizations are:

  • suppress unused imports
  • replace text with raw text (when applicable)
  • use quickAppendList syntax (L+=[] instead of L=L+[])
  • remove unused entries or methods from imports
  • remove unused entries from within method scopes
  • replace method calls by inlining embedded commands (when applicable)
  • perform substitutions of entries by constant values (when applicable)
Edited by Antonio Prates