tweaks and improvements for main files

- use define() instead of const for global constants

- use more meaningful and consistent names for constants

- define "int $index" instead of "bool $nuvola"
  as optional argument for getFlag()

- enforce 2-argument mode for getApi()

- define Orig as abstract class

- use !== to compare with `null`