created more functions

Worked a little on the functions for JavaScript implementation. Figured
out proper behavior for borrow and carry functions. Must figure out how
to properly create a sprite array and map changes to the screen.