Added logic unit functions, removed some console.log()'s, corrected std __if__ function