zero bug + some parts where rewritten

* Now returns صفر when number is zero (bug)
* Lists were moved outside of functions for better performance.
* Some if-expressions where converted to if-statements (for better understandability and also easier conversion to Lua. Old code is still available, only is commented out)