extending classes from javascript