[refactor] ruby functions

- move many Sass user functions to ruby function declarations
- refactor existing ruby files `ui.rb` and `util.rb` to better organize the logic