Added flip macro and ls-ns (publics).
Added tests for flip functions