Cleaned up javascript file. All functions are now in the gcans object.