beginning to implement functions in pile, gonna move functiosn into js files later

next commit will have things moved around