Added a Pixel class to the JS, bugfixes