Boundary Conditions, Minor Bugs Fixed

Added in periodic boundary conditions as an option. Now changing number
of grid points in sketching view changes the width of the sketching view
correctly. Added onDetach method to animation fragment which prevents
the app from crashing when back button is pressed.