Add fillRect method
Add in-memory functions and some cleanup