add cartodb sql functions and first viewer version