added empty pivot index files for ruby and js
added assert method and empty pivot_index method
made pivot index work
refactored a lot