initial rerack.js rewrite - base functionality